package com.mxpio.erp.quality.utils;

import com.mxpio.erp.common.enums.InspectionEnums;
import com.mxpio.erp.common.jpa.model.QualityOrder;
import com.mxpio.erp.common.jpa.model.QualityOrderLine;
import com.mxpio.erp.common.quality.entity.*;
import com.mxpioframework.common.exception.MBootException;

/**
 * @Author : wpp
 * @Datetime : 2024/8/7 17:57
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc :
 */
public class QualityUtils {
    public static Class<? extends QualityOrderLine> getQualityOrderLineClass(String originBizType) {
        if (InspectionEnums.OriginBizType.MANF.getCode().equals(originBizType)) {
            return MoInQualityOrderLine.class;
        } else if (InspectionEnums.OriginBizType.PURCH.getCode().equals(originBizType)) {
            return InQualityOrderLine.class;
        } else if (InspectionEnums.OriginBizType.OUTS.getCode().equals(originBizType)) {
            return OoInQualityOrderLine.class;
        } else if (InspectionEnums.OriginBizType.INVENTORY.getCode().equals(originBizType)) {
            return InventoryQualityOrderLine.class;
        } else if (InspectionEnums.OriginBizType.SALERE.getCode().equals(originBizType)) {
            return SoInQualityOrderLine.class;
        }else{
            throw new MBootException("未知的源单类型");
        }
    }
    public static Class<? extends QualityOrder> getQualityOrderClass(String originBizType) {
        if (InspectionEnums.OriginBizType.MANF.getCode().equals(originBizType)) {
            return MoInQualityOrder.class;
        } else if (InspectionEnums.OriginBizType.PURCH.getCode().equals(originBizType)) {
            return InQualityOrder.class;
        } else if (InspectionEnums.OriginBizType.OUTS.getCode().equals(originBizType)) {
            return OoInQualityOrder.class;
        } else if (InspectionEnums.OriginBizType.INVENTORY.getCode().equals(originBizType)) {
            return InventoryQualityOrder.class;
        } else if (InspectionEnums.OriginBizType.SALERE.getCode().equals(originBizType)) {
            return SoInQualityOrder.class;
        }else{
            throw new MBootException("未知的源单类型");
        }
    }
}
